import React, {useEffect, useState} from 'react';

export default () => {
  const [count, setCount] = useState({number:0});

  useEffect(() => {
    console.log('trigger effect')
  }, [count]); //todo 见 关于 00hooks/01useEffect/关于setTimeout与setInterval.tsx、关于shouldComponentUpdate.tsx

  console.log('render');

  return (
    <div>
      <p>{count.number}</p>
      <button onClick={()=>setCount({number:1})}>button</button>
    </div>
  )
};
